#!/bin/bash -e

pushd ${BASH_SOURCE%/*} > /dev/null

# Linking testcheck
npm link

# Loop through integrations, testing each
for integration in *; do
  [ -d "${integration}" ] || continue
  printf "\e[43;30m Test Integration: ${integration} \e[0m\n\n"
  pushd ${integration} > /dev/null
  npm link testcheck
  npm install --no-package-lock --no-shrinkwrap
  npm test
  popd > /dev/null
done

popd > /dev/null

# Cleanup testcheck link
npm unlink
